package io.github.codelifeleno.jdbrelease.config;

import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;

/**
 * 标记注释行的开头
 */
public class SingleLine {
    /**
     * 注释头
     */
    private List<String> prefixes = List.of("--");

    @Override
    public String toString() {
        return new StringJoiner(", ", SingleLine.class.getSimpleName() + "[", "]")
                .add("prefixes=" + prefixes)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;

        SingleLine that = (SingleLine) o;
        return Objects.equals(getPrefixes(), that.getPrefixes());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getPrefixes());
    }

    public List<String> getPrefixes() {
        return prefixes;
    }

    public void setPrefixes(List<String> prefixes) {
        this.prefixes = prefixes;
    }

    public SingleLine() {
    }

    public SingleLine(List<String> prefixes) {
        this.prefixes = prefixes;
    }
}
